package se.emilsjolander.sprinkles;

import android.database.sqlite.SQLiteDatabase;

public abstract class Migration {

    final void execute(SQLiteDatabase db, int oldVersion, int newVersion) {
        onPreMigrate();
        doMigration(db, oldVersion, newVersion);
        onPostMigrate();

    }

    protected void onPreMigrate(){}
    protected abstract void doMigration(SQLiteDatabase db, int oldVersion, int newVersion);
    protected void onPostMigrate(){}

}
